package com.eden.controller;

import com.eden.common.R;
import com.eden.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tags")
public class TagsController {

    @Autowired
    private TagService tagService;

    @GetMapping("/hot")
    public R hot(){
        int limit = 6;

        return tagService.hots(limit);

    }
    @GetMapping
    public R findAll(){
        //查询所有的文章标签

        return tagService.findAll();
    }

    @GetMapping("detail")
    public R findAllDetail(){
        return tagService.findAllDetail();
    }

}
